#include <iostream>
#include <string>

using namespace std;

int main() {
  string s;
  int f_num = 0, l_num = 0, i_num = 0;
  cin >> s;
  for (auto it = s.begin(); it != s.end() - 1; it++) {
    if (*it == 'f') {
      switch (*(it + 1)) {
      case 'f':
        ++f_num;
        break;
      case 'l':
        ++l_num;
        break;
      case 'i':
        ++i_num;
        break;
      default:
        break;
      }
    }
  }
  cout << f_num << " " << l_num << " " << i_num << endl;
}